package com.itheima.Demo01.demo01;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;

public class Network02S {
    public static void main(String[] args) throws IOException {
        DatagramSocket Data = new DatagramSocket(10000);
        byte[]arr = new byte[1024];
        DatagramPacket DP = new DatagramPacket(arr,arr.length);
        Data.receive(DP);
        String S = new String(arr,0,DP.getLength());
        System.out.println(S);
        Data.close();
    }
}
